package example.array;

/**
 * Created by lenovo on 2016/11/4 0004.
 * extended扩展数组元素
 */
public class Extend {
    public static void main(String[] args) {
        String[] origin = new String[]{"A", "B", "C"};
        String[] extended = new String[5];
        extended[3] = "D";
        extended[4] = "E";
        //copy origin数组的全部数字到extended中的前三位（刚好origin的元素个数）
        System.arraycopy(origin, 0, extended, 0, origin.length);
        for (String str : extended) {
            System.out.println(str);
        }
    }
}
